package com.allenkerr.client;

import com.allenkerr.vo.CountryCityData;
import com.allenkerr.vo.GlobeData;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * Created by 小柯(Allen Kerr) on 17.6.25 00:40.
 */
@FeignClient(name = "globe", url = "http://alpha-geo.fishtrip.cn")
public interface GlobeFeignClient {

    /*@GetMapping("/internal_api/v1/countries")
    String getCountryCities(@RequestParam("page") int page, @RequestParam("per_page") int size,
                            @RequestParam Map<String, Object> map);

    @GetMapping("/internal_api/v1/cities")
    String getCities(@RequestParam("page") int pageIndex, @RequestParam("per_page") int pageSize,
                     @RequestParam("country_id") String countryId, @RequestParam Map<String, Object> map);*/

    /**
     * 获取国家
     */
    @GetMapping("/internal_api/v1/countries/simple_list")
    String getCountries(@RequestParam Map<String, Object> map);

    /**
     * 获取国家
     */
    @GetMapping("/internal_api/v1/countries/simple_list")
    GlobeData getCountriesToVo(@RequestParam Map<String, Object> map);

    /**
     * 获取城市
     */
    @GetMapping("/internal_api/v1/countries/{country_id}/cities")
    String getCities(@PathVariable("country_id") Integer countryId,
                     @RequestParam("page") int page, @RequestParam Map<String, Object> map);

    /**
     * 获取城市
     */
    @GetMapping("/internal_api/v1/countries/{country_id}/cities")
    GlobeData getCitiesToVo(@PathVariable("country_id") Integer countryId,
                                             @RequestParam("page") int page, @RequestParam Map<String, Object> map);

}
